﻿<?xml version="1.0" encoding="utf-8" ?>
<wit:WITD xmlns:wit="http://schemas.microsoft.com/VisualStudio/2005/workitemtracking/typedef" version="1.0">
  <WORKITEMTYPE name="WssTask">
    <FIELDS>
      <FIELD name="Work Item Type" refname="System.WorkItemType" type="String" reportable="dimension" />
      <FIELD name="ID" refname="System.Id" type="Integer" reportable="dimension" />
      <FIELD name="Title" refname="System.Title" type="String" reportable="dimension">
        <REQUIRED />
      </FIELD>
      <FIELD name="State" refname="System.State" type="String" reportable="dimension" />
      <FIELD name="Rev" refname="System.Rev" type="Integer" reportable="dimension" />
      <FIELD name="Revised Date" refname="System.RevisedDate" type="DateTime" />
      <FIELD name="Changed By" refname="System.ChangedBy" type="String" reportable="dimension">
        <VALIDUSER />
        <ALLOWEXISTINGVALUE />
      </FIELD>
      <FIELD name="Created Date" refname="System.CreatedDate" type="DateTime" />
      <FIELD name="Created By" refname="System.CreatedBy" type="String" reportable="dimension" />
      <FIELD name="Assigned To" refname="System.AssignedTo" type="String" reportable="dimension">
        <VALIDUSER />
        <ALLOWEXISTINGVALUE />
      </FIELD>
      <FIELD name="Description" refname="System.Description" type="PlainText" />

      <FIELD name="Wss Priority" refname="Wss.Priority" type="String" reportable="dimension">
        <HELPTEXT>The priority of the task</HELPTEXT>
        <ALLOWEDVALUES expanditems="true">
          <LISTITEM value="(1) High" />
          <LISTITEM value="(2) Normal" />
          <LISTITEM value="(3) Low" />
        </ALLOWEDVALUES>
        <DEFAULT from="value" value="(2) Normal" />
      </FIELD>
      <FIELD name="Wss % Complete" refname="Wss.PercentComplete" type="String" reportable="dimension">
        <HELPTEXT>The workflow state of the task</HELPTEXT>
      </FIELD>
      <FIELD name="Wss Start Date" refname="Wss.StartDate" type="DateTime" reportable="dimension">
        <HELPTEXT>The date to start the task</HELPTEXT>
      </FIELD>
      <FIELD name="Wss Due Date" refname="Wss.DueDate" type="DateTime" reportable="dimension">
        <HELPTEXT>The date the task is due</HELPTEXT>
      </FIELD>

    </FIELDS>
    <WORKFLOW>
      <STATES>
        <STATE value="Not Started"/>
        <STATE value="In Progress"/>
        <STATE value="Completed"/>
        <STATE value="Deferred"/>
        <STATE value="Waiting on someone else"/>
      </STATES>
      <TRANSITIONS>


        <TRANSITION from="" to="Not Started">
          <REASONS>
            <DEFAULTREASON value="Because" />
          </REASONS>
          <FIELDS>
            <FIELD refname="System.AssignedTo">
              <DEFAULT from="currentuser" />
            </FIELD>
          </FIELDS>
        </TRANSITION>

        <TRANSITION from="Not Started" to="In Progress">
          <REASONS>
            <DEFAULTREASON value="Because" />
          </REASONS>
          <FIELDS>
            <FIELD refname="System.AssignedTo">
              <DEFAULT from="currentuser" />
            </FIELD>
          </FIELDS>
        </TRANSITION>
        <TRANSITION from="Not Started" to="Completed">
          <REASONS>
            <DEFAULTREASON value="Because" />
          </REASONS>
          <FIELDS>
            <FIELD refname="System.AssignedTo">
              <DEFAULT from="currentuser" />
            </FIELD>
          </FIELDS>
        </TRANSITION>
        <TRANSITION from="Not Started" to="Deferred">
          <REASONS>
            <DEFAULTREASON value="Because" />
          </REASONS>
          <FIELDS>
            <FIELD refname="System.AssignedTo">
              <DEFAULT from="currentuser" />
            </FIELD>
          </FIELDS>
        </TRANSITION>
        <TRANSITION from="Not Started" to="Waiting on someone else">
          <REASONS>
            <DEFAULTREASON value="Because" />
          </REASONS>
          <FIELDS>
            <FIELD refname="System.AssignedTo">
              <DEFAULT from="currentuser" />
            </FIELD>
          </FIELDS>
        </TRANSITION>

        <TRANSITION from="In Progress" to="Not Started">
          <REASONS>
            <DEFAULTREASON value="Because" />
          </REASONS>
          <FIELDS>
            <FIELD refname="System.AssignedTo">
              <DEFAULT from="currentuser" />
            </FIELD>
          </FIELDS>
        </TRANSITION>
        <TRANSITION from="In Progress" to="Completed">
          <REASONS>
            <DEFAULTREASON value="Because" />
          </REASONS>
          <FIELDS>
            <FIELD refname="System.AssignedTo">
              <DEFAULT from="currentuser" />
            </FIELD>
          </FIELDS>
        </TRANSITION>

        <TRANSITION from="In Progress" to="Waiting on someone else">
          <REASONS>
            <DEFAULTREASON value="Because" />
          </REASONS>
          <FIELDS>
            <FIELD refname="System.AssignedTo">
              <DEFAULT from="currentuser" />
            </FIELD>
          </FIELDS>
        </TRANSITION>

        <TRANSITION from="Waiting on someone else" to="In Progress">
          <REASONS>
            <DEFAULTREASON value="Because" />
          </REASONS>
          <FIELDS>
            <FIELD refname="System.AssignedTo">
              <DEFAULT from="currentuser" />
            </FIELD>
          </FIELDS>
        </TRANSITION>

        <TRANSITION from="Deferred" to="In Progress">
          <REASONS>
            <DEFAULTREASON value="Because" />
          </REASONS>
          <FIELDS>
            <FIELD refname="System.AssignedTo">
              <DEFAULT from="currentuser" />
            </FIELD>
          </FIELDS>
        </TRANSITION>

        <TRANSITION from="Deferred" to="Not Started">
          <REASONS>
            <DEFAULTREASON value="Because" />
          </REASONS>
          <FIELDS>
            <FIELD refname="System.AssignedTo">
              <DEFAULT from="currentuser" />
            </FIELD>
          </FIELDS>
        </TRANSITION>

      </TRANSITIONS>
    </WORKFLOW>
    <FORM>
      <Layout>
        <Group>
          <Column PercentWidth="100">
            <Control Type="FieldControl" FieldName="System.Title" Label="&amp;Title:" LabelPosition="Left" />
          </Column>
        </Group>
        <Group Label="Status">
          <Column PercentWidth="33">
            <Control Type="FieldControl" FieldName="Wss.Priority" Label="&amp;Priority:" LabelPosition="Left" />
            <Control Type="FieldControl" FieldName="System.State" Label="&amp;State:" LabelPosition="Left" />
          </Column>
          <Column PercentWidth="33">
            <Control Type="FieldControl" FieldName="Wss.PercentComplete" Label="Perce&amp;nt complete:" LabelPosition="Left" />
            <Control Type="FieldControl" FieldName="System.AssignedTo" Label="Assi&amp;gned to:" LabelPosition="Left" />
          </Column>
          <Column PercentWidth="34">
            <Control Type="FieldControl" FieldName="Wss.StartDate" Label="Start Dat&amp;e:" LabelPosition="Left" />
            <Control Type="FieldControl" FieldName="Wss.DueDate" Label="D&amp;ue Date:" LabelPosition="Left" />
          </Column>
        </Group>
        <TabGroup>
          <Tab Label="Description">
            <Control Type="HtmlFieldControl" FieldName="System.Description" Label="Des&amp;cription:" LabelPosition="Top" Dock="Fill" />
          </Tab>
          <Tab Label="History">
            <Control Type="WorkItemLogControl" FieldName="System.History" Label="&amp;History:" LabelPosition="Top" Dock="Fill" />
          </Tab>
          <Tab Label="File Attachments">
            <Control Type="AttachmentsControl" />
          </Tab>
        </TabGroup>
      </Layout>
    </FORM>
  </WORKITEMTYPE>
</wit:WITD>

